package com.firefly.dao.assembler.cms;
import com.firefly.dao.dao.cms.po.AdPo;
import com.firefly.dao.dto.cms.AdDto;
import com.firefly.dao.vo.cms.AdVo;
import org.springframework.stereotype.Component;

/**
 * @description: 广告类型转换
 * @author: lzg(萤火科技 ： 854378082 @ qq.com)
 * @date: 2022/12/18
 **/
@Component
public class AdAssembler {
    public AdPo getPo(AdDto request){
        AdPo entity = new AdPo();
        entity.setId(request.getId());
        entity.setPosId(request.getPosId());
        entity.setTitle(request.getTitle());
        entity.setThumb(request.getThumb());
        entity.setUrl(request.getUrl());
        entity.setStarttime(request.getStarttime());
        entity.setEndtime(request.getEndtime());
        entity.setSort(request.getSort());
        entity.setStatus(request.getStatus());
        return entity;
    }

    public AdVo getVo(AdPo entity){
        AdVo detail = new AdVo();
        detail.setId(entity.getId());
        detail.setPosId(entity.getPosId());
        detail.setTitle(entity.getTitle());
        detail.setThumb(entity.getThumb());
        detail.setUrl(entity.getUrl());
        detail.setStarttime(entity.getStarttime());
        detail.setEndtime(entity.getEndtime());
        detail.setSort(entity.getSort());
        detail.setStatus(entity.getStatus());
        return detail;
    }
}
